clear

* use data entitled Experiment 3 Mturk.dta (ignore my filepath in the next line)
use "c:/bnewman transferred files/research/representation/income and dr/experiment 3 mturk for replication.dta"

* a bit of cleaning
drop if finished=="FALSE"


gen vignette=.
*control Republican
replace vignette=2 if q39=="I have read the above description."
*control Democrat
replace vignette=1 if var27=="I have read the above description."
*mid Republican
replace vignette=4 if q40=="I have read the above description."
*mid Democrat
replace vignette=3 if v4=="I have read the above description."
*high Republican
replace vignette=6 if q41=="I have read the above description."
*high Democrat
replace vignette=5 if v6=="I have read the above description."

rename description_1 leadership
rename description_2 cares
rename description_3 honesty
rename description_4 intelligence

replace leadership="1" if leadership=="Not well at all"
replace leadership="2" if leadership=="Slightly well"
replace leadership="3" if leadership=="Moderately well"
replace leadership="4" if leadership=="Very well"
replace leadership="5" if leadership=="Extremely well"

replace cares="1" if cares=="Not well at all"
replace cares="2" if cares=="Slightly well"
replace cares="3" if cares=="Moderately well"
replace cares="4" if cares=="Very well"
replace cares="5" if cares=="Extremely well"

replace honesty="1" if honesty=="Not well at all"
replace honesty="2" if honesty=="Slightly well"
replace honesty="3" if honesty=="Moderately well"
replace honesty="4" if honesty=="Very well"
replace honesty="5" if honesty=="Extremely well"

replace intelligence="1" if intelligence=="Not well at all"
replace intelligence="2" if intelligence=="Slightly well"
replace intelligence="3" if intelligence=="Moderately well"
replace intelligence="4" if intelligence=="Very well"
replace intelligence="5" if intelligence=="Extremely well"

replace intelligence="1" if intelligence=="Not well at all"
replace intelligence="2" if intelligence=="Slightly well"
replace intelligence="3" if intelligence=="Moderately well"
replace intelligence="4" if intelligence=="Very well"

replace rep="1" if rep=="Very poorly"
replace rep="2" if rep=="Somewhat poorly"
replace rep="3" if rep=="Somewhat well"
replace rep="4" if rep=="Very well"

replace vc="1" if vc=="I would definitely not vote for this candidate."
replace vc="2" if vc=="I would probably not vote for this candidate."
replace vc="3" if vc=="I would probably vote for this candidate."
replace vc="4" if vc=="I would definitely vote for this candidate."

destring leadership cares honesty intelligence rep vc, replace

rename vc votechoice
rename rep represent

gen var_cont=0
gen var_mid=0
gen var_high=0

replace var_cont=1 if vignette==1 | vignette==2
replace var_mid=1 if vignette==3 | vignette==4
replace var_high=1 if vignette==5 | vignette==6

* Recode all to 0-1 scale
gen leadership01=(leadership-1)/4
gen intelligent01=(intelligence-1)/4
gen cares01=(cares-1)/4
gen honest01=(honest-1)/4
gen represent01=(represent-1)/3
gen votechoice01=(votechoice-1)/3


* set up treatment so that 0 = no income stated, 1 = 75k, 2 = 3 million

gen treatment_recode=.
replace treatment_recode=0 if var_cont==1
replace treatment_recode=1 if var_mid==1
replace treatment_recode=2 if var_high==1


* Figure 1 (0-1 scale)

mean leadership01, over (treatment_recode)
mean intelligent01, over (treatment_recode)
mean cares01, over (treatment_recode)
mean honest01, over (treatment_recode)
mean represent01, over (treatment_recode)
mean votechoice01, over (treatment_recode)

* regression setup for hypothesis tests, comparison group is 0, no income stated
reg leadership01 i.treatment_recode
reg intelligent01 i.treatment_recode
reg cares01 i.treatment_recode
reg honest01 i.treatment_recode
reg represent01 i.treatment_recode
reg votechoice01 i.treatment_recode


* Figure 2 bars are comparison of $3 million (category 2) - no income stated (0 or "base")

reg leadership01 i.treatment_recode
contrast treatment_recode, effects

reg intelligent01 i.treatment_recode
contrast treatment_recode, effects

reg cares01 i.treatment_recode
contrast treatment_recode, effects

reg honest01 i.treatment_recode
contrast treatment_recode, effects

reg represent01 i.treatment_recode
contrast treatment_recode, effects

reg votechoice01 i.treatment_recode
contrast treatment_recode, effects

* oprobits for appendix

oprobit leadership i.treatment_recode
oprobit intelligent i.treatment_recode
oprobit honesty i.treatment_recode
oprobit cares i.treatment_recode
oprobit represent i.treatment_recode
oprobit votechoice i.treatment_recode


